home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / yerk / mps231ss.hqx / Mops source / More classes / MW documents / MWtest < prev    next >
Text File  |  1990-02-28  |  2KB  |  75 lines

  1. \ Test code for MW docs.
  2.  
  3. need    MWdocs
  4.  
  5. :f I/O_ERR   3 beep  ." I/O Error " .s  quit  ;f    \ *** TESTING
  6.  
  7.  file+    FF
  8.  
  9.     0    value    SV_VREF
  10.  
  11.  : QQIN
  12.     ff -> theFcb
  13.     new: fmt_run  new: para_run  new: text
  14.     new: style_names
  15.     MWDOC_TYPE  'type TEXT 2
  16. \    thedoc  %open: ff  0EXIT
  17. \    true  fixup: thedoc  drop
  18.     stdget: ff  0EXIT
  19.     getVref: ff  -> sv_vref
  20.     open: ff  OK?
  21.     ff bring: thedoc
  22.     close: ff  OK?
  23.     true  fixup: thedoc  drop
  24.     mystery?
  25.     IF  3 beep  ." Mystery - code:"  unprocessed_code .  THEN
  26.  ;
  27.  
  28. scon    $EH    "--x"    & x  $ 10  instead
  29. scon    $OH    "--x"    & x  $ 11  instead
  30. scon    $EF    "--x"    & x  $ 12  instead
  31. scon    $OF    "--x"    & x  $ 13  instead
  32. scon    $1H    "--x"    & x  $ 14  instead
  33. scon    $1F    "--x"    & x  $ 15  instead
  34. scon    $END    "--x"    & x  $ 16  instead
  35. scon    $GR    "--x"    & x    1  instead
  36. scon    $SECT    "--x"    & x  $  C  instead
  37.  
  38. : HF
  39.     true -> facing_pages?
  40.     " \eh"  $EH    replAll: text
  41.     " \oh"    $OH    replAll: text
  42.     " \ef"    $EF    replAll: text
  43.     " \of"    $OF    replAll: text
  44.     " \1h"    $1H    replAll: text
  45.     " \1f"    $1F    replAll: text
  46.     " \xx"    $END    replAll: text
  47.     " \gr"    $GR    replAll: text
  48.     " \se"    $SECT    replAll: text  ;
  49.  
  50.  : QQOUT
  51.     'type WDBN  'type MSWD   " Save mw 3.0 doc"  getName: ff
  52. \    'type WDBN  'type WORD   " Save mw 1.05 doc"  getName: ff
  53.     swap over  pad swap cmove  dup pad +  & x swap c!
  54.     pad swap 1+
  55.     name: ff  2drop
  56.     sv_vref  setVref: ff
  57.     thedoc    create&save: ff
  58. \    stdput: ff  0EXIT  create: ff  OK?  set: ff
  59. \    ff send: thedoc
  60. \    thedoc  %saveAs: ff  drop
  61.  ;
  62.  
  63.  : TEST
  64.     qqin  qqout  ;
  65.  
  66.  : ZZ    release: fmt_run  release: para_run  release: text
  67.     release: style_names  release: tmp
  68.     release: thefile  release: changes
  69.     release: fmt_ov_str  release: fmt_ov_run
  70.     release: para_ov_str  release: sect_offsets  release: sect_ov_str
  71.     release: buf  release: buf_offsets
  72.     release: fmt_blk#s  release: para_blk#s
  73.     close: ff drop
  74. ;
  75.